<template>
  <div class="app-main">
    <div class="pet-container">
      <div v-for="item in serviceList" :key="item.id" class="pet-item">
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span><svg-icon icon-class="service" class="service-icon"/>{{ item.name }}</span>
            <el-button style="float: right; padding: 3px 0" type="text"><svg-icon icon-class="price" class="service-icon"/>{{ item.price }}元</el-button>
          </div>
          <div class="text item">
            {{ item.remarks }}
          </div>
        </el-card>
      </div>
    </div>
  </div>
</template>

<script>
import {getServiceList} from "@/api/service";

export default {
  name: "index",
  data() {
    return {
      serviceList: []
    }
  },
  created() {
    this.queryData()
  },
  methods: {
    queryData() {
      let params = {
        pageNo: 1,
        pageSize: 1000
      }
      getServiceList(params).then(response => {
        if(response.code === 200) {
          this.serviceList = response.data.list
        } else {
          this.$message.error(response.msg);
        }
      })
    },
  }
}
</script>

<style lang="scss" scoped>
.app-main {
  padding: 10px;
  box-sizing: border-box;
  .pet-container {
    display: flex;
    flex-wrap: wrap;
    .pet-item {
      padding: 10px 15px;
      width: 348px;
      height: 100%;
      .service-icon {
        font-size: 18px;
        margin-right: 5px;
      }
      .text {
        height: 150px;
      }
    }
  }
}
</style>

